package work20241212;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zdl
 * @date 2024/12/12
 */
class SelfException extends RuntimeException {
    public SelfException(String message){
        super(message);
    }
}
public class Demo {
    public static void main(String[] args) throws Exception{
       login("123","123");
    }
    public static void  login(String username,String password){
        if (!username.equals("123")){
            throw  new SelfException("用户名不对");
        }
        if (!password.equals("123")){
            throw new SelfException("密码不对");
        }
        System.out.println("登录成功");
    }
}
